<%include pub/admin_head.html%>
    </head>
    <body>
        <!-- Page Container -->
        <div class="page-container">
            <!-- Page Sidebar -->
            <%include pub/admin_nav.html%>
            <!-- Page Content -->
            <div class="page-content">
                <!-- Page Header -->
                
                <%include pub/admin_top.html%>
                <div class="page-inner">
                    <div id="main-wrapper">
                        <div class="row">
                            <div class="col-lg-3 col-md-6">
                                <div class="panel panel-white stats-widget">
                                    <div class="panel-body">
                                        <div class="pull-left">
                                            <span class="stats-number"><%- usernum %></span>
                                            <p class="stats-info">总用户量</p>
                                        </div>
                                        <div class="pull-right">
                                            <i class="icon-arrow_upward stats-icon"></i>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-3 col-md-6">
                                <div class="panel panel-white stats-widget">
                                    <div class="panel-body">
                                        <div class="pull-left">
                                            <span class="stats-number"><%- worknum %></span>
                                            <p class="stats-info">总作品数</p>
                                        </div>
                                        <div class="pull-right">
                                            <i class="icon-arrow_upward stats-icon"></i>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="rows">
                            <div class="col-md-12">
                                <div class="page-title">
                                    <h3 class="breadcrumb-header">网站轮播图</h3>
                                </div>
                                <div class="panel panel-white">
                                    <div class="panel-body">
                                        <button type="button" class="btn btn-success" data-toggle="modal" data-target="#index-banner" id="add_banner">+ 新增轮播图</button>
                                        <table class="table" style="margin-top: 10px;">
                                            <thead>
                                                <tr>
                                                    <th>序号</th>
                                                    <th>图片简介</th>
                                                    <th>跳转链接</th>
                                                    <th>操作</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <%if(banners){%>
                                                    <%for(let i=0; i< banners.length;i++){%>
                                                    <tr>
                                                        <th scope="row"><%= i+1 %></th>
                                                        <td><%= banners[i].title %></td>
                                                        <td><%= banners[i].url %></td>
                                                        <td>
                                                            <button type="button" class="btn btn-primary change-banner" data-id="<%- banners[i]._id %>" data-toggle="modal" data-target="#index-banner">修改</button>
                                                            <button type="button" class="btn btn-danger del-banner" data-id="<%- banners[i]._id %>">删除</button>
                                                        </td>
                                                    </tr>
                                                <%}}%>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="rows">
                            <div class="col-md-12">
                                <div class="page-title">
                                    <h3 class="breadcrumb-header">全站推送消息</h3>
                                </div>
                                <div class="col-md-4">
                                    <div class="form-group">
                                        <label>标题</label>
                                        <input type="text" class="form-control" id="ts-all-title" />
                                    </div>
                                    <div class="form-group">
                                        <label>推送内容</label>
                                        <textarea class="form-control" rows="4" id="ts-all-content"></textarea>
                                    </div>
                                    <button type="button" class="btn btn-success" id="ts-all">开始推送</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="modal fade bs-example-modal-sm" id="index-banner" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
            <div class="modal-dialog modal-sm">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title" id="mySmallModalLabel">轮播图</h4>
                    </div>
                    <div class="modal-body">
                        <input type="hidden" id="banner-hidden" value=""/>
                        <div class="form-group">
                            <label for="image-title">图片简介</label>
                            <input type="text" class="form-control" id="image-title" name="image-title"/>
                        </div>
                        <div class="form-group">
                            <label for="image-title">选择图片</label>
                            <div type="text" class="form-control cho-image">
                                <span class="forimgaename">点击选择图片</span>
                                <input type="file" id="banner-img-upload" class="banner-img-file" name="banner-img-upload">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="banner-url">链接地址(没有请填“#”)</label>
                            <input type="text" class="form-control" id="banner-url" name="banner-url"/>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-success" id="upload-banner-img">上传</button>
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    </div>
                </div>
            </div>
        </div>
        <!-- Javascripts -->
        <%include pub/admin_foot.html%>
    </body>
</html>